<%@ page contentType="text/html;charset=utf-8" %>
<%@ page import="ut.data.User" %>
<%@ page import="ut.data.Transaction" %>
<%
	User user = (User)session.getAttribute("user");
	if(user == null){
		response.sendRedirect("/");
		return;
	}
	
	int reservedMoney = Transaction.getReservedMoney(user.id);
%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>UT終極一翻！ | 提款至PayPal</title>
	<link rel="stylesheet" type="text/css" href="/style.css" media="all" />
	<script type="text/javascript" src="/js/Utility.js"></script>
	<script type="text/javascript" src="/js/Message.js"></script>
	<script type="text/javascript" src="/js/Ajax.js"></script>
	<script type="text/javascript" src="/js/Button.js"></script>
	<script type="text/javascript" src="/js/Account.js"></script>
	<script type="text/javascript" src="/script.js"></script>
</head>
<body onload="init();">
<%@ include file="/include/banner.jsp" %>
	<div class="content">
		<div class="title">提款至PayPal</div>
		<form class="block-center" method="post" onsubmit="Account.withdraw(this);return false;">
			您的帳戶餘額：NTD <%= user.money %> 元<br/>
			可提領的金額：NTD <%= user.money - reservedMoney %> 元<br/>
			<span class="mark-gray comment">（為保障案主、譯者與本站的權益，款項必須在案件完成三天後，才能提領。）</span><br/>
			<input type="hidden" name="reserved" value="<%= user.money - reservedMoney %>" /><br/>
			
			請輸入欲提款的金額：NTD <input type="text" class="center" style="width:80px" name="money" /> 元<br/>
			<span class="mark-gray comment">（單次提款最低 NTD 200 元，最高 NTD 100000 元。）</span><br/>
			<br/>
			請輸入欲收款的 PayPal E-Mail 帳號：<input type="text" class="center" style="width:250px" name="email" /><br/>
			<span class="mark-red comment">
				請務必填寫正確的 PayPal E-Mail 帳號。若因您的輸入錯誤導致金錢損失，本站將不負任何責任。
			</span><br/>
			<span class="mark-red comment">送出提款申請後，站務人員將於三個工作天內盡快處理，請耐心等候。</span><br/>
			<span class="mark-red comment">
				每次提款，本站將收取 <%= user.fee %>% 的服務費用。
			</span><br/>
			<br/>
			<input type="checkbox" name="agree" /> 我已了解並同意以上的注意事項。<br/>
			
			<input class="button" style="margin-top:30px" type="submit" value="提款至【PayPal】"
				onmousedown="this.style.borderStyle='inset'"
				onmouseup="this.style.borderStyle='outset'"
				onmouseout="this.style.borderStyle='outset'" />
		</form>
<%@ include file="/include/foot.jsp" %>
	</div>
</body>
</html>